ifeq ($(KERNELRELEASE),)
	KERNELDIR ?= ../linux-3.12
	PWD := $(shell pwd)
modules:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules
modules_install:
	$(MAKE) -C $(KERNELDIR) M=$(PWD) modules_install
else
	MODULE_NAME := jz2440_buttons
	obj-m := $(MODULE_NAME).o
endif

.PHONY: clean
clean:
	@rm -rf *.ko *.o *~ *.mod.c *.order *.symvers .*.o.cmd .*.ko.cmd 
